package com.iad.model.valueobject {
  
  import flash.events.EventDispatcher;
  
  import mx.collections.ArrayCollection;
  
  [Bindable]
  [RemoteClass(alias="com.iad.entity.Site")]
  public class  Site extends EventDispatcher {
  
    public var id:Number;
    public var name:String;
    public var bandCity:String;
    public var bandState:String;
    public var firstName:String;
    public var lastName:String;
    public var password:String;
    public var email:String;
    public var ownerId:Number;
    public var imagePath:String;
    public var active:Boolean;
    public var currentPlaylistId:Number;
    public var videos:ArrayCollection;
    public var playlists:ArrayCollection;
    public var reviews:ArrayCollection;
    public var discographyItems:ArrayCollection;
    public var url:String;
    public var pathLabel:String;
    public var admin:Boolean;
    
    public function Site() {
    }
    
    public override function toString():String {
      var str:String;
      str = 
      "Site(" + "\n" + 
      "\tid= " + id+ "\n" + 
      "\tname= " + name + "\n" + 
      "\townerId = " + ownerId + "\n" + 
      "\timagePath= " + imagePath + "\n" + 
      "\turl= " + url + "\n" + 
      "\tpathLabel= " + pathLabel + "\n" + 
      "\tactive= " + active + "\n" + 
      "\tcurrentPlaylistId= " + currentPlaylistId + "\n" + 
      playlistsToString() +
      reviewsToString() +
      videosToString() +
      ")\n\n" +  
      "===================================================\n\n";
      return str;
    }
    
    public function playlistsToString():String {
      var str:String = "playlists: [" + playlists.length + "]\n";
      for each (var playlist:Playlist in playlists) {
        str += playlist.toString(); 
      }
      return str;
    }
    
    
    public function reviewsToString():String {
      var str:String = "reviews: [" + reviews.length + "]\n";
      for each (var review:Review in reviews) {
        str += review.toString(); 
      }
      return str;
    }
    
    
    public function videosToString():String {
      var str:String = "videos: [" + videos.length + "]\n";
      for each (var video:Video in videos) {
        str += video.toString(); 
      }
      return str;
    }
  
  }
  
}